
#pragma once

#include <QMutex>
#include <QString>
#include <QCoreApplication>

#define LOG_FILE_NAME  QCoreApplication::applicationDirPath() + "/Log/" + QDateTime::currentDateTime().toString("yyyy-MM-dd-hh-mm-ss") + QString(".log")

static int s_logLevel = 0;
static QMutex s_logMutex;
static QString s_logPath;


void setLogPath(const QString &path);
void setLogLevel(int level);
void customLogMessageHandler(QtMsgType type, const QMessageLogContext& ctx, const QString& msg);

void remove_old_log_file();
